package com.ruoyi.yljf.controller.AppController;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.security.annotation.Anonymous;
import com.ruoyi.yljf.domain.Book;
import com.ruoyi.yljf.domain.vo.BookVO;
import com.ruoyi.yljf.service.IBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

/**
 * 书籍Controller
 * 
 * @author metaee
 * @date 2025-02-12
 */
@Anonymous
@RestController
@RequestMapping("api/book")
public class ApiBookController extends BaseController {
    @Autowired
    private IBookService bookService;

    /**
     * 查询书籍列表
     */
    @GetMapping("/list")
    public TableDataInfo list(Book book) {
        startPage();
        List<BookVO> list = bookService.qyeryBookList(book);
        return getDataTable(list);
    }
    
    /**
     * 获取书籍详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        BookVO bookVO = bookService.queryById(id);
        return success();
    }
    
}
